/*
 * Copyright © 2017 eqxiu.com 北京中网易企秀科技有限公司  All rights reserved.
 */

package cn.hermit.examples.dubbo.provider.api.impl;

import cn.hermit.examples.dubbo.api.BookStoreApi;
import cn.hermit.examples.dubbo.dto.BookDto;

import java.util.ArrayList;
import java.util.List;

/**
 * @author JackGao 高建国
 * @description //TODO 设计说明
 * @date 8/4/2017
 */
public class BookStoreApiImpl implements BookStoreApi {

    @Override
    public List<BookDto> findAllBooks() {
        List<BookDto> books = new ArrayList<>();
        books.add(new BookDto(0, "OSGi in Action", "Jack"));
        books.add(new BookDto(1, "AngularJS in Action", "Jack"));
        books.add(new BookDto(2, "Spring Boot in Action", "Jack"));
        books.add(new BookDto(3, "MyCat in Action", "Jack"));
        books.add(new BookDto(4, "Docker in Action", "Jack"));
        books.add(new BookDto(5, "Kubernetes in Action", "Jack"));
        books.add(new BookDto(6, "Spring Cloud in Action", "Jack"));
        return books;
    }

    @Override
    public BookDto[] findSomeBooks() {
        List<BookDto> books = new ArrayList<>();
        books.add(new BookDto(0, "OSGi in Action", "Jack"));
        books.add(new BookDto(1, "AngularJS in Action", "Jack"));
        books.add(new BookDto(2, "Spring Boot in Action", "Jack"));
        books.add(new BookDto(3, "MyCat in Action", "Jack"));
        books.add(new BookDto(4, "Docker in Action", "Jack"));
        books.add(new BookDto(5, "Kubernetes in Action", "Jack"));
        books.add(new BookDto(6, "Spring Cloud in Action", "Jack"));
        return books.toArray(new BookDto[]{});
    }

    @Override
    public BookDto findBookById(int id) {
        return new BookDto(0, "OSGi in Action", "Jack");
    }
}
